package com.bangdream.michelia.view.fragment.main;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bangdream.michelia.R;
import com.bangdream.michelia.application.MainApplication;
import com.bangdream.michelia.presenter.base.BasePresenter;
import com.bangdream.michelia.tool.StatusBarTool;
import com.bangdream.michelia.utils.L;
import com.bangdream.michelia.view.fragment.currency.BaseFragment;

/**
 * Created by Mr.Wang on 2018/4/8.
 * 909732184@qq.com
 * 个人中心
 */

public class Personal extends BaseFragment {
    private View view;
    private LinearLayout topViewLayout;
    private View statusBarHeight;
    private TextView tv_title;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.item_personal,container,false);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView();
    }

    @Override
    public BasePresenter createPresenter() {
        return null;
    }

    private void initView() {
        topViewLayout = view.findViewById(R.id.topViewLayout);
        tv_title = view.findViewById(R.id.tv_title);
        if(MainApplication.getInstance().getWidth()>0){
            //topViewLayout.getLayoutParams().height = (int) (MainApplication.getInstance().getWidth()*(float)(409/540));
            topViewLayout.getLayoutParams().height = (int)(MainApplication.getInstance().getWidth()*0.8);
            L.d("topViewLayout高度为："+topViewLayout.getLayoutParams().height);
        }
        tv_title.setText("个人中心");
        statusBarHeight = getView().findViewById(R.id.statusBarHeight);
        statusBarHeight.getLayoutParams().height = StatusBarTool.getStatusHeight(getActivity());
    }
}
